package learn.opencv.chapter02;

import static com.googlecode.javacv.cpp.opencv_core.IPL_DEPTH_8U;
import static com.googlecode.javacv.cpp.opencv_core.cvCreateImage;
import static com.googlecode.javacv.cpp.opencv_core.cvGetSize;
import static com.googlecode.javacv.cpp.opencv_core.cvReleaseImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvDestroyWindow;
import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvNamedWindow;
import static com.googlecode.javacv.cpp.opencv_highgui.cvShowImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvWaitKey;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_GAUSSIAN;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvSmooth;

import com.googlecode.javacv.cpp.opencv_core.IplImage;

/**
 * Created with IntelliJ IDEA. User: joey Date: 22/3/14 Time: 下午8:36 To change
 * this template use File | Settings | File Templates.
 */
public class Ex4 {

    public static void main(String[] args) {

        IplImage image = cvLoadImage("art5014360081-s.jpg");

        cvNamedWindow("Example4-in");
        cvNamedWindow("Example4-out");

        cvShowImage("Example4-in", image);
        IplImage out = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3);

        cvSmooth(image, out, CV_GAUSSIAN, 5, 5, 0, 0);

        cvShowImage("Example4-out", out);

        cvReleaseImage(out);

        cvWaitKey(0);

        cvDestroyWindow("Example4-in");
        cvDestroyWindow("Example4-out");

    }

}
